/**
 */
package at.fhooe.agaeScriptDsl.impl;

import at.fhooe.agaeScriptDsl.AgaeScriptDslPackage;
import at.fhooe.agaeScriptDsl.HandlerItem;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Handler Item</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link at.fhooe.agaeScriptDsl.impl.HandlerItemImpl#getName <em>Name</em>}</li>
 *   <li>{@link at.fhooe.agaeScriptDsl.impl.HandlerItemImpl#getComponentToName <em>Component To Name</em>}</li>
 *   <li>{@link at.fhooe.agaeScriptDsl.impl.HandlerItemImpl#getComponentFromName <em>Component From Name</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class HandlerItemImpl extends MinimalEObjectImpl.Container implements HandlerItem
{
  /**
   * The default value of the '{@link #getName() <em>Name</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getName()
   * @generated
   * @ordered
   */
  protected static final String NAME_EDEFAULT = null;

  /**
   * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getName()
   * @generated
   * @ordered
   */
  protected String name = NAME_EDEFAULT;

  /**
   * The default value of the '{@link #getComponentToName() <em>Component To Name</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getComponentToName()
   * @generated
   * @ordered
   */
  protected static final String COMPONENT_TO_NAME_EDEFAULT = null;

  /**
   * The cached value of the '{@link #getComponentToName() <em>Component To Name</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getComponentToName()
   * @generated
   * @ordered
   */
  protected String componentToName = COMPONENT_TO_NAME_EDEFAULT;

  /**
   * The default value of the '{@link #getComponentFromName() <em>Component From Name</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getComponentFromName()
   * @generated
   * @ordered
   */
  protected static final String COMPONENT_FROM_NAME_EDEFAULT = null;

  /**
   * The cached value of the '{@link #getComponentFromName() <em>Component From Name</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getComponentFromName()
   * @generated
   * @ordered
   */
  protected String componentFromName = COMPONENT_FROM_NAME_EDEFAULT;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  protected HandlerItemImpl()
  {
    super();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  protected EClass eStaticClass()
  {
    return AgaeScriptDslPackage.Literals.HANDLER_ITEM;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public String getName()
  {
    return name;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setName(String newName)
  {
    String oldName = name;
    name = newName;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, AgaeScriptDslPackage.HANDLER_ITEM__NAME, oldName, name));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public String getComponentToName()
  {
    return componentToName;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setComponentToName(String newComponentToName)
  {
    String oldComponentToName = componentToName;
    componentToName = newComponentToName;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, AgaeScriptDslPackage.HANDLER_ITEM__COMPONENT_TO_NAME, oldComponentToName, componentToName));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public String getComponentFromName()
  {
    return componentFromName;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setComponentFromName(String newComponentFromName)
  {
    String oldComponentFromName = componentFromName;
    componentFromName = newComponentFromName;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, AgaeScriptDslPackage.HANDLER_ITEM__COMPONENT_FROM_NAME, oldComponentFromName, componentFromName));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public Object eGet(int featureID, boolean resolve, boolean coreType)
  {
    switch (featureID)
    {
      case AgaeScriptDslPackage.HANDLER_ITEM__NAME:
        return getName();
      case AgaeScriptDslPackage.HANDLER_ITEM__COMPONENT_TO_NAME:
        return getComponentToName();
      case AgaeScriptDslPackage.HANDLER_ITEM__COMPONENT_FROM_NAME:
        return getComponentFromName();
    }
    return super.eGet(featureID, resolve, coreType);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eSet(int featureID, Object newValue)
  {
    switch (featureID)
    {
      case AgaeScriptDslPackage.HANDLER_ITEM__NAME:
        setName((String)newValue);
        return;
      case AgaeScriptDslPackage.HANDLER_ITEM__COMPONENT_TO_NAME:
        setComponentToName((String)newValue);
        return;
      case AgaeScriptDslPackage.HANDLER_ITEM__COMPONENT_FROM_NAME:
        setComponentFromName((String)newValue);
        return;
    }
    super.eSet(featureID, newValue);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eUnset(int featureID)
  {
    switch (featureID)
    {
      case AgaeScriptDslPackage.HANDLER_ITEM__NAME:
        setName(NAME_EDEFAULT);
        return;
      case AgaeScriptDslPackage.HANDLER_ITEM__COMPONENT_TO_NAME:
        setComponentToName(COMPONENT_TO_NAME_EDEFAULT);
        return;
      case AgaeScriptDslPackage.HANDLER_ITEM__COMPONENT_FROM_NAME:
        setComponentFromName(COMPONENT_FROM_NAME_EDEFAULT);
        return;
    }
    super.eUnset(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public boolean eIsSet(int featureID)
  {
    switch (featureID)
    {
      case AgaeScriptDslPackage.HANDLER_ITEM__NAME:
        return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
      case AgaeScriptDslPackage.HANDLER_ITEM__COMPONENT_TO_NAME:
        return COMPONENT_TO_NAME_EDEFAULT == null ? componentToName != null : !COMPONENT_TO_NAME_EDEFAULT.equals(componentToName);
      case AgaeScriptDslPackage.HANDLER_ITEM__COMPONENT_FROM_NAME:
        return COMPONENT_FROM_NAME_EDEFAULT == null ? componentFromName != null : !COMPONENT_FROM_NAME_EDEFAULT.equals(componentFromName);
    }
    return super.eIsSet(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public String toString()
  {
    if (eIsProxy()) return super.toString();

    StringBuffer result = new StringBuffer(super.toString());
    result.append(" (name: ");
    result.append(name);
    result.append(", componentToName: ");
    result.append(componentToName);
    result.append(", componentFromName: ");
    result.append(componentFromName);
    result.append(')');
    return result.toString();
  }

} //HandlerItemImpl
